package com.example.springbootdemo.strategy.optimizeifelse.strategy;

import com.baomidou.mybatisplus.core.enums.IEnum;

/**
 * Account type
 *
 * @author 92942
 */
public enum UserType implements IEnum {
    ADMIN(0, "Admin", "ROLE_ADMIN"),
    AGENT(2, "Agent", "ROLE_AGENT"),
    WORKER(4, "Worker", "ROLE_WORKER"),;

    private Integer value;
    private String desc;
    private String authority;

    /**
     * 算是枚举的构造函数吗？
     * @param value
     * @param desc
     * @param authority
     */
    UserType(Integer value, final String desc, String authority) {
        this.value = value;
        this.desc = desc;
        this.authority = authority;
    }

    public String getAuthority() {
        return authority;
    }


    @Override
    public Integer getValue() {
        return this.value;
    }

    public String getDesc() {
        return this.desc;
    }

}
